Makefile-tests.am: make check uses the built binaries
authorGiuseppe Scrivano <gscrivan@redhat.com>
Thu, 14 Jul 2016 11:42:32 +0000 (13:42 +0200)
committerAtomic Bot <atomic-devel@projectatomic.io>
Thu, 14 Jul 2016 13:26:48 +0000 (13:26 +0000)
The tests suite was failing locally as it was using the installed
version of rofiles-fuse, instead of the built one.  Create the needed
symlinks in tests/ as we are already doing for the "ostree" binary.

ostree-prepare-root and ostree-remount added for completeness.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Closes: #395
Approved by: cgwalters

Makefile-tests.am

index e274c5e6eba3bb2983101e0422c71a45e3062cfd..0b6b64e9810652c8f0f4c4c4999e68f970fd9b9a 100644 (file)
@@ -33,7 +33,8 @@ TESTS_ENVIRONMENT += OT_TESTS_DEBUG=1 \
        PATH=$$(cd $(top_builddir)/tests && pwd):$${PATH} \
        $(NULL)
 
-uninstalled_test_data = tests/ostree-symlink-stamp
+uninstalled_test_data = tests/ostree-symlink-stamp tests/ostree-prepare-root-symlink-stamp \
+                       tests/ostree-remount-symlink-stamp tests/rofiles-fuse-symlink-stamp
 
 dist_uninstalled_test_scripts = tests/test-symbols.sh
 
@@ -238,12 +239,19 @@ EXTRA_DIST += \
 tests/libreaddir-rand.so: Makefile
        $(AM_V_GEN) ln -fns ../.libs/libreaddir-rand.so tests
 ALL_LOCAL_RULES += tests/libreaddir-rand.so
-CLEANFILES += tests/libreaddir-rand.so tests/ostree-symlink-stamp tests/ostree
+CLEANFILES += tests/libreaddir-rand.so tests/ostree-symlink-stamp \
+               tests/ostree-prepare-root-symlink-stamp tests/ostree-remount-symlink-stamp \
+               tests/rofiles-fuse-symlink-stamp tests/ostree
 
-tests/ostree-symlink-stamp: Makefile
+tests/%-symlink-stamp: Makefile
        @set -e; \
-       real_bin=`cd $(top_builddir) && ./libtool --mode=execute echo ostree`; \
-       ln -sf "$${real_bin}" tests/ostree; \
+       lt_bin=`cd $(top_builddir) && ./libtool --mode=execute echo $*`; \
+       if test "$${lt_bin}" = "$*"; then \
+               real_bin=$(abs_top_builddir)/$*; \
+       else \
+               real_bin="$${lt_bin}"; \
+       fi; \
+       ln -sf "$${real_bin}" tests/$*; \
        touch $@
 
 # Unfortunately the glib test data APIs don't actually handle